package com.example.flower_shop.dto.product;

import com.example.flower_shop.dto.category.CategoryVO;
import com.example.flower_shop.entity.Product;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@Data
@NoArgsConstructor
public class ProductVO {
    private Long id;
    private CategoryVO category;
    private String name;
    private String description;
    private BigDecimal price;
    private Integer stock;
    private String imageUrl;
    private Integer status;

    public ProductVO(Product product) {
        this.id = product.getId();
        this.category = new CategoryVO(product.getCategory());
        this.name = product.getName();
        this.description = product.getDescription();
        this.price = product.getPrice();
        this.stock = product.getStock();
        this.imageUrl = product.getImageUrl();
        this.status = product.getStatus();
    }
}